import Vue from "vue";
Vue.directive("btntest", {
  bind: function(el, binding, vnode) {
    console.log(el);
    el.addEventListener(
      "click",
      event => {
        el.__vue__.loading = true;
      },
      true
    );
    el.addEventListener("click", event => {
      el.__vue__.loading = false;
    });
  },
  inserted: function(el, binding, vnode) {
    // console.log("inserted时父节点为:%O", el.parentNode);
    // console.log("触发inserted指令钩子函数");
  },
  update: function(el) {
    // console.log("触发update指令钩子函数");
  },
  componentUpdated: function(el) {
    // console.log("触发componentUpdated指令钩子函数");
  },
  unbind: function(el) {
    // console.log("触发unbind指令钩子函数");
  }
});
